home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / frame_24 / PlaceObject2_869_102 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2008-09-24  |  988 b   |  63 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.paused)
  3.    {
  4.       return undefined;
  5.    }
  6.    if(!_root.sound)
  7.    {
  8.       ufoS.setVolume(0);
  9.    }
  10.    if(getTimer() > resetTime)
  11.    {
  12.       changeDir();
  13.       resetTime = getTimer() + delay;
  14.    }
  15.    if(dir == "left")
  16.    {
  17.       _X = _X - speed;
  18.    }
  19.    if(dir == "right")
  20.    {
  21.       _X = _X + speed;
  22.    }
  23.    if(_X > 500)
  24.    {
  25.       dir = "left";
  26.    }
  27.    if(_X < 100)
  28.    {
  29.       dir = "right";
  30.    }
  31.    time++;
  32.    if(time > 80)
  33.    {
  34.       bomb();
  35.       time = 0;
  36.    }
  37.    if(!damage)
  38.    {
  39.       if(this.box.hitTest(_root.car))
  40.       {
  41.          _root.cSound();
  42.          damage = true;
  43.          health -= 20;
  44.          _root.car.ySpeed = (- _root.car.ySpeed) * 0.3;
  45.       }
  46.    }
  47.    if(damage)
  48.    {
  49.       _alpha = random(100) + 10;
  50.       t++;
  51.       if(t > 20)
  52.       {
  53.          t = 0;
  54.          _alpha = 100;
  55.          damage = false;
  56.       }
  57.    }
  58.    if(_root.car.dead)
  59.    {
  60.       ufoS.stop();
  61.    }
  62. }
  63.